package com.meitianhui.convenitenbuy.module.wallet.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.meitianhui.convenitenbuy.R;
import com.meitianhui.convenitenbuy.module.wallet.model.FamilyCard;

import java.util.List;

/**
 * Created by Administrator on 2017/11/3.
 * 拼团领
 */
public class WalletCardsAdapter extends BaseQuickAdapter<FamilyCard, BaseViewHolder> {
    private Context context;

    public WalletCardsAdapter(Context context, List<FamilyCard> data) {
        super(R.layout.item_wallet_cards, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, FamilyCard card) {
        if (card != null) {
            TextView view = helper.getView(R.id.tv_wallet_cards_item);
            view.setText(TextUtils.isEmpty(card.getCard_no()) ? context.getString(R.string
                    .wallet_cards_empty) :
                    card.getRemark());
        }
    }

}
